package com.solairen.myapplication.Pager.HomePager;

import android.content.Intent;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.Button;

import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.fragment.app.Fragment;

import com.solairen.myapplication.R;
import com.solairen.myapplication.camera.PhotoActivity;

public class HomeFragment extends Fragment {

    @Nullable
    @Override
    public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
        // 在这里设置 home_fragment 的布局文件
        View rootView = inflater.inflate(R.layout.fragment_home, container, false);
        Button quickScan = rootView.findViewById(R.id.quickScanButton);

        /**************设置监视器*****************/
        quickScan.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                Intent intent = new Intent(getActivity(), PhotoActivity.class);
                startActivity(intent);
            }
        });
        return rootView;
    }
}

